﻿<%@ Page Language="C#" AutoEventWireup="true" validaterequest="false" CodeBehind="new.aspx.cs" Inherits="AnyOffice.general.work_plan.manage._new" %>

<%@ Register TagPrefix="fckeditorv2" Namespace="FredCK.FCKeditorV2" Assembly="FredCK.FCKeditorV2" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>发布项目</title>
		<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
		<meta name="CODE_LANGUAGE" Content="C#">
		<meta name="vs_defaultClientScript" content="JavaScript">
		<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
		<link rel="stylesheet" type="text/css" href="/module/date_selector/popcalendar.css">
		<script src="/module/date_selector/popcalendar.js"></script>
		<script src="/aspnet_client/core/function.js"></script>
		<script Language="JavaScript">		
		function CheckForm()
		{
			if (document.Form1.txtName.value=="")
			{
			    alert("项目的名称不能为空！");
				document.Form1.txtName.focus();
				return (false);
			}
			
			if (document.Form1.ddlTypeId.value=="")
			{
			    alert("请选择项目的类型！");
				return (false);
			}		
		
			var oEditor = FCKeditorAPI.GetInstance('txtContent');
			if(oEditor.GetHTML() == "")  
			{
			    alert("项目的内容为空！");
				return (false);
			}
			if(!checkIsDate(document.Form1.txtBeginDate.value))
			{
				alert("生效日期不正确！");
				document.Form1.txtBeginDate.focus();
				return (false);
			}
			   
			if(!checkIsDate(document.Form1.txtEndDate.value))
			{
				alert("终止日期不正确！");
				document.Form1.txtEndDate.focus();
				return (false);
			}
			
			if ((document.Form1.ToId.value=="") && (document.Form1.ParticipatorId.value==""))
			{
				alert("请指定发布范围或参与人不能同时为空！");
				return (false);
			} 
			
			if (document.Form1.ddlTypeId.value=="")
			{
			    alert("项目类型不能为空！");
				document.Form1.ddlTypeId.focus();
				return (false);
			}			
			return true;
		}

		function CheckFile()
		{
			if (document.Form1.fileAttach.value=="")
			{
				alert("请选择附件！");
				return (false);
			}   
			return true;	
		}
			
		</script>
	</HEAD>
	<body class="bodycolor" style="padding-top:0;" topmargin="5">
		<form id="Form1" method="post" runat="server">	
        <div class="main_div">		
			<asp:Panel id="pnlMain" runat="server">
			<table border="0" width="90%" cellspacing="0" cellpadding="3" class="small">
				<tr>
					<td class="tab_ti">
						新建项目
					</td>
				</tr>
			</table>
			<br>
				<TABLE class="tab_pub" cellSpacing="0" cellPadding="0" width="90%" align="center" border="0">
					<TR>
						<TD class="ta_bg" noWrap width="10%">项目名称：</TD>
						<TD class="ta_txt"><INPUT class="BigInput" id="txtName" type="text" maxLength="200" size="50" name="txtName"
								runat="server"></TD>
					</TR>
					
					<TR>
						<TD class="ta_bg" noWrap>开始日期：</TD>
						<TD class="ta_txt"><INPUT class="BigInput" id="txtBeginDate" type="text" maxLength="10" size="12" name="txtBeginDate" runat="server"> <IMG style="CURSOR: hand" onClick="popUpCalendar(this,txtBeginDate,'yyyy-mm-dd','');"
								src="/module/date_selector/calendar.gif" align="absMiddle" border="0">
							
						</TD>
					</TR>
					<TR>
						<TD class="ta_bg" noWrap>预计完成日期：</TD>
						<TD class="ta_txt"><INPUT class="BigInput" id="txtEndDate" type="text" maxLength="10" size="12" name="txtEndDate" runat="server"> <IMG style="CURSOR: hand" onClick="popUpCalendar(this,txtEndDate,'yyyy-mm-dd','');" src="/module/date_selector/calendar.gif"
								align="absMiddle" border="0">
						</TD>
					</TR>
					<TR>
						<TD class="ta_bg" noWrap>项目类型：</TD>
						<TD class="ta_txt">
							<asp:DropDownList id="ddlTypeId" runat="server" CssClass="BigSelect"></asp:DropDownList>
						</TD>
					</TR>
					<TR>
						<TD class="ta_bg" noWrap>发布范围（机构）：</TD>
						<TD class="ta_txt"><TEXTAREA class="BigStatic fl" id="ToName" name="ToName" rows="2" readOnly wrap="yes" cols="45"
								runat="server"></TEXTAREA>
								<INPUT class="bnt_Add fl" style="width:46px; display:inline-table;" title="添加部门" onClick="dept_select('ToId','ToName','');" type="button" value="添加"
								name="button">
								<INPUT class="bnt_Del fl" style="width:46px; display:inline-table;" title="清空部门" onClick="clear_double('ToId','ToName');" type="button" value="清空"
								name="button"><INPUT id="ToId" type="hidden" name="ToId" runat="server">
						</TD>
					</TR>
					<TR>
						<TD class="ta_bg" noWrap>参与人：</TD>
						<TD class="ta_txt"><TEXTAREA class="BigStatic fl" id="ParticipatorName" name="ParticipatorName" rows="2" readOnly
								wrap="yes" cols="45" runat="server"></TEXTAREA>
								<INPUT class="bnt_Add fl" style="width:46px; display:inline-table;" title="添加用户" onClick="user_select('ParticipatorId','ParticipatorName');" type="button" value="添加"
								name="button">
								<INPUT class="bnt_Del fl" style="width:46px; display:inline-table;" title="清空用户" onClick="clear_double('ParticipatorId','ParticipatorName');" type="button" value="清空"
								name="button"><INPUT id="ParticipatorId" type="hidden" name="ParticipatorId" runat="server"></TD>
					</TR>
					<TR>
						<TD class="ta_bg" noWrap>汇报人：</TD>
						<TD class="ta_txt"><TEXTAREA class="BigStatic fl" id="ManagerName" name="ManagerName" rows="2" readOnly wrap="yes"
								cols="45" runat="server"></TEXTAREA>
								<INPUT class="bnt_Add fl" style="width:46px; display:inline-table;" title="添加用户" onClick="user_select('ManagerId','ManagerName');" type="button" value="添加"
								name="button">
								<INPUT class="bnt_Del fl" style="width:46px; display:inline-table;" title="清空用户" onClick="clear_double('ManagerId','ManagerName');" type="button" value="清空"
								name="button"><INPUT id="ManagerId" type="hidden" name="ManagerId" runat="server"></TD>
					</TR>
					<TR>
						<TD class="ta_bg" noWrap>附件：</TD>
						<TD class="ta_txt">
							<asp:Panel id="pnlAttach" runat="server" Visible="False">
								<asp:ListBox id="ltbFileList" runat="server" Rows="1"></asp:ListBox>
								<asp:button id="btnRemoveFile" runat="server" CssClass="bnt_Del" Text="删除" onclick="btnRemoveFile_Click"></asp:button>
							</asp:Panel></TD>
					</TR>
					<TR>
						<TD class="ta_bg" noWrap>附件上传：</TD>
						<TD class="ta_txt"><INPUT class="SmallInput" id="fileAttach" type="file" size="26" name="fileAttach" runat="server">
							<asp:button id="btnAddFile" runat="server" CssClass="bnt_Add" Text="添加" onclick="btnAddFile_Click"></asp:button></TD>
					</TR>
					<TR>
						<TD class="ta_bg" noWrap>附件说明：</TD>
						<TD class="ta_txt"><TEXTAREA class="BigInput" id="txtAttachmentComment" name="txtAttachmentComment" rows="2"
								wrap="yes" cols="45" runat="server"></TEXTAREA></TD>
					</TR>
					<TR>
						<TD class="ta_bg" noWrap>备注：</TD>
						<TD class="ta_txt"><TEXTAREA class="BigInput" id="txtRemark" name="txtRemark" rows="2" cols="45" runat="server"></TEXTAREA></TD>
					</TR>
					<TR>
						<TD class="ta_bg" noWrap>目前状态：</TD>
						<TD class="ta_txt">
							<INPUT onClick="status_change();" id="rdoStatus0" type="radio" CHECKED value="0" name="RadioGroup" runat="server"><SPAN style="COLOR: red">未开始</SPAN>
							<INPUT onClick="status_change();" id="rdoStatus1" type="radio" value="1" name="RadioGroup" runat="server"><SPAN style="COLOR: blue">进行中</SPAN>
							<INPUT onClick="status_change();" id="rdoStatus2" type="radio" value="2" name="RadioGroup" runat="server"><SPAN style="COLOR: green">完成</SPAN>
						</TD>
					</TR>
					<TR>
						<TD class="ta_bg" noWrap>目前完成百分比：</TD>
						<TD class="ta_txt">
							<select class="BigSelect" name="sltCompletedPercent" id="sltCompletedPercent" onChange="percent_change()" runat="server">
								<option value="0">0%</option>
								<option value="1">10%</option>
								<option value="2">20%</option>
								<option value="3">30%</option>
								<option value="4">40%</option>
								<option value="5">50%</option>
								<option value="6">60%</option>
								<option value="7">70%</option>
								<option value="8">80%</option>
								<option value="9">90%</option>
								<option value="10">100%</option>
							</select>
						</TD>
					</TR>
					<TR>
						<TD class="ta_bg" noWrap>提醒：</TD>
						<TD class="ta_txt">
							<asp:CheckBox id="ckbSms" runat="server" Text="使用内部短信提醒员工" Checked="True"></asp:CheckBox>
							<asp:CheckBox id="ckbMobile" runat="server" Visible="False" Text="使用手机短信提醒员工"></asp:CheckBox></TD>
					</TR>
					<TR>
						<TD class="ta_bg" noWrap>项目内容：</TD>
						<TD class="ta_txt">
							<FCKeditorV2:FCKeditor id="txtContent" runat="server" Width="100%" Height="250px" ToolbarSet="Basic"></FCKeditorV2:FCKeditor>
						</TD>
					</TR>
					<TR align="center">
						<TD noWrap colSpan="2" class="bnt_con">
							<asp:Button id="btnSubmit" runat="server" CssClass="BigButton" Text="提 交" onclick="btnSubmit_Click"></asp:Button>
							<INPUT class="BigButton" onClick="location='new.aspx'" type="button" value="重 填">
						</TD>
					</TR>
				</TABLE>
				<script type="text/javascript" language="JavaScript">		
				function status_change()
				{
					if(document.getElementById("rdoStatus0").checked)
						document.getElementById("sltCompletedPercent").selectedIndex=0;
					if(document.getElementById("rdoStatus2").checked)
						document.getElementById("sltCompletedPercent").selectedIndex=10;
				}
				
				function percent_change()
				{
					if(document.getElementById("sltCompletedPercent").value == "0")
					{
						document.getElementById("rdoStatus0").checked = true;
						document.getElementById("rdoStatus1").checked = false;
						document.getElementById("rdoStatus2").checked = false;
					}
					else if(document.getElementById("sltCompletedPercent").value == "10")
					{
						document.getElementById("rdoStatus0").checked = false;
						document.getElementById("rdoStatus1").checked = false;
						document.getElementById("rdoStatus2").checked = true;
					}
					else
					{
						document.getElementById("rdoStatus0").checked = false;
						document.getElementById("rdoStatus1").checked = true;
						document.getElementById("rdoStatus2").checked = false;						
					}
				}		
				</script>
				<BR>
			</asp:Panel>
			<asp:Literal id="litMessage" runat="server"></asp:Literal>
            </div>
		</form>
	</body>
</HTML>
